package wjp.service.impl;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import wjp.bean.Active;
import wjp.bean.ActiveRecord;
import wjp.bean.Result;
import wjp.bean.User;
import wjp.dao.ActiveRecordDao;
import wjp.service.ActiveRecordService;

@Transactional
public class ActiveRecordServiceImpl implements ActiveRecordService {
	private ActiveRecordDao activeRecordDao;

	public ActiveRecordDao getActiveRecordDao() {
		return activeRecordDao;
	}

	public void setActiveRecordDao(ActiveRecordDao activeRecordDao) {
		this.activeRecordDao = activeRecordDao;
	}

	@Override
	public List<ActiveRecord> list(String serachStr, Integer pageNum,
			Integer numPerPage) {
		return activeRecordDao.list(serachStr, pageNum, numPerPage);
	}

	@Override
	public Result<ActiveRecord> findById(int id) {
		// TODO Auto-generated method stub
		return activeRecordDao.findById(id);
	}

	@Override
	public void save(ActiveRecord activeRecord) {
		activeRecordDao.save(activeRecord);
	}

	@Override
	public void update(ActiveRecord activeRecord) {
		activeRecordDao.update(activeRecord);
	}

	@Override
	public void delete(ActiveRecord activeRecord) {
		activeRecordDao.delete(activeRecord);
	}

	@Override
	public void delete(int id) {
		activeRecordDao.delete(id);
	}

	@Override
	public Integer totalCount(String serachStr) {
		// TODO Auto-generated method stub
		return activeRecordDao.totalCount(serachStr);
	}

	@Override
	public Result<User> apiList(Active active, int from, int pagerCount) {
		return activeRecordDao.apiList(active, from, pagerCount);
	}

	@Override
	public Result<Active> personList(User user, int from, int pagerCount) {
		// TODO Auto-generated method stub
		return activeRecordDao.personList(user, from, pagerCount);
	}

	@Override
	public void delete(Active active, User user) {
		activeRecordDao.delete(active, user);
	}

}
